﻿import QtQuick 2.0
import QtQuick.Controls 2.12
import QtQuick.Layouts 1.12
import ConfigElementType 1.0
import "qrc:/qmlComponents/ConfigManager"
import "qrc:/qmlComponents/AxisModulePos"
import "qrc:/qmlComponents/VisionViewer"
import "qrc:/qmlComponents/CustomizedUIElement"

Item {
    ColumnLayout{
        spacing: 20
        RowLayout{
            ColumnLayout{
                VisionLocationViewer{
                    calibrationName: "SUTUpLookCameraCalibration"
                    visionLocationName: "UpLookCameraLocation"
                }

                XYZModulePos{
                    moduleName: "SUTXYZ"
                    posName: "UpLookCalibratePrPos"
                }
            }
            ColumnLayout{
                VisionLocationViewer{
                    calibrationName: "ShotterDownLookCameraCalibration"
                    visionLocationName: "DispenDownLookLocation"
                }

                XYZModulePos{
                    moduleName: "SUTXYZ"
                    posName: "ShotterPrPos"
                }
            }
        }

        Rectangle{
            color: "pink"
            width: 650
            height: 2
        }

        XYZModulePos{
            moduleName: "SUTXYZ"
            posName: "UpLookAndDownLookPrPos"
        }

        ConfigRow{
            configName: "upLookCameraToDownLookCameraOffsetX"
            configModel: aaConfig
            Component.onCompleted: {
                autoInit()
            }
        }

        ConfigRow{
            configName: "upLookCameraToDownLookCameraOffsetY"
            configModel: aaConfig
            Component.onCompleted: {
                autoInit()
            }
        }

        ConfigRow{
            configName: "upLookCameraToDownLookCameraOffsetTheta"
            configModel: aaConfig
            Component.onCompleted: {
                autoInit()
            }
        }

        Button{
            text: qsTr("CalibrateDownLookToUpLookCameraOffset")
            onClicked: {
                tem.runSingleCmd(aaHead, "calibrateDownLookToUpLookCameraOffset")
            }
        }
    }
}
